package OfferCode;

import java.util.Stack;

/**
 * @Author Kechelle
 * @Date 2020/9/21 21:10
 * @Version 1.0
 */
public class Code9 {
    public static boolean isPalindrome(int x){
        if (x<0) return false;
        String res = String.valueOf(x);
        int center = res.length()/2;
        int left = 0;
        int right = res.length()-1;
        for (int i=0;i<center;i++){
            if (res.charAt(left) != res.charAt(right)) return false;
            left++;
            right--;
        }
        return true;
    }

    public static void main(String[] args) {
        System.out.println(isPalindrome(1000021));
    }
}
